/**
 * @param {number[]} nums
 * @return {void} Do not return anything, modify nums in-place instead.
 */
 var moveZeroes = function(nums) {
    if(nums.length == 1) return nums;
    let left = right = 0;
    while(right < nums.length){
        let temp;
        if(nums[right] !== 0){
            let temp = nums[left]
            nums[left] = nums[right];
            nums[right] = temp;
            left++;
        }
        right++;
    }
    return nums;
};

nums = [0,1,0,3,12]
console.log(moveZeroes(nums));

num1 = [1, 0]
console.log(moveZeroes(num1));
